package chapter1.subclass.duck;

import chapter1.subclass.fly.FlyWithWings;
import chapter1.subclass.quack.Quack;
import chapter1.superclass.Duck;

/**
 * @author 张超
 * @date 2017/4/14
 */
public class MallardDuck extends Duck {
    public MallardDuck() {
        //运行时指定行为
        quackBehavior = new Quack();
        flyBehavior = new FlyWithWings();
    }

    @Override
    public void display() {
        System.out.println("i am a real mallard duck");
    }
}
